/**
* @file ClientPlatform.h
* @author Lost
* @date 一月 2020
* @brief
* 虚拟客户端平台
*/
#ifndef __CLIENT_PLATFORM_H__
#define __CLIENT_PLATFORM_H__


#include "Singleton.h"
#include "BaseApp.h"
#include "packet.pb.h"

#include "MsgMgr.h"
#include "cs_login.pb.h"
#include "Log.h"

#ifdef _WIN32
#include <hash_map>
using namespace stdext;
#else
#include <ext/hash_map>
using namespace __gnu_cxx;
#endif

/**
 * @brief 客户端平台
 */
class CClientPlatform : public CSingleton<CClientPlatform>
{
public:
    CClientPlatform();
    ~CClientPlatform();
public:

    /**
    * @brief 初始化
    */
    bool Init();

    /**
    * @brief 开始运行
    */
    int Run(int argc, char** argv);

    /**
     * @brief 控制台处理
     */
    virtual int HandleConsole(vector<string> vecParam);
    /**
     * @brief 报文处理
     */
    virtual int HandleMsg(const comm::Head &pbHead, const std::string &pszBody);
private:
    /**
    * @brief 添加路由器
    */
    //bool AddApp(comm::EnmModule eModule, CBaseApp *pBaseApp);

private:
    /*!< 报文路由表 */
    typedef hash_multimap<int, CBaseApp *> CmdMultiMap;
    CmdMultiMap m_multimapModuleRoute;

};


#endif